<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>"> 
    <title>用户增加</title>
   <script type="text/javascript" src="<%=basePath%>/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){
    	$("#userid").attr("disabled", "disabled");
    	$("addUser").click(function(){
    		$.ajax({
    			data:$("#userForm").serializeArray(),
    			url:"saveUser.do",
    			dataType:"JSON",
    			type:"POST",
    			success:function(result){
    				alert("增加成功");
    			}
    		});
    	});
    });  
    </script>
  </head>
  <body>
    <form action="saveuser.do" name="userForm" id="userForm"  method="post" onsubmit="return checkInfo();">
		<input type="hidden" name="userid" id="userid"/>
	<table border="0" cellpadding="0" cellspacing="2">
		<tr>
			<th>用户名:</th>
			<td><input type="text" name="username" id="loginname"/></td>
		</tr>
		<tr>
			<th>密　码:</th>
			<td><input type="password" name="password" id="password"/></td>
		</tr>

		<tr>
			<th>角色编号:</th>
			<td><input type="text" name="roleid" id="roleid" /></td>
		</tr>
		<tr>
			<td>
				<button id="addUser" >增加用户</button>
			</td>
		</tr>
	</table>
	</form>
  </body>
</html>
